@planu/cli 0.29.0 → 0.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/license-plans.json +7 -1
- package/dist/engine/ci-generator/planu-config.d.ts +7 -0
- package/dist/engine/ci-generator/planu-config.d.ts.map +1 -0
- package/dist/engine/ci-generator/planu-config.js +40 -0
- package/dist/engine/ci-generator/planu-config.js.map +1 -0
- package/dist/engine/ci-generator/planu-steps.d.ts +11 -0
- package/dist/engine/ci-generator/planu-steps.d.ts.map +1 -0
- package/dist/engine/ci-generator/planu-steps.js +292 -0
- package/dist/engine/ci-generator/planu-steps.js.map +1 -0
- package/dist/engine/spec-templates/catalog-industry.d.ts +4 -0
- package/dist/engine/spec-templates/catalog-industry.d.ts.map +1 -0
- package/dist/engine/spec-templates/catalog-industry.js +19 -0
- package/dist/engine/spec-templates/catalog-industry.js.map +1 -0
- package/dist/engine/spec-templates/catalog.d.ts +1 -1
- package/dist/engine/spec-templates/catalog.d.ts.map +1 -1
- package/dist/engine/spec-templates/catalog.js +3 -1
- package/dist/engine/spec-templates/catalog.js.map +1 -1
- package/dist/engine/spec-templates/custom-loader.d.ts +12 -0
- package/dist/engine/spec-templates/custom-loader.d.ts.map +1 -0
- package/dist/engine/spec-templates/custom-loader.js +99 -0
- package/dist/engine/spec-templates/custom-loader.js.map +1 -0
- package/dist/engine/spec-templates/index.d.ts +4 -2
- package/dist/engine/spec-templates/index.d.ts.map +1 -1
- package/dist/engine/spec-templates/index.js +4 -2
- package/dist/engine/spec-templates/index.js.map +1 -1
- package/dist/engine/spec-templates/query.d.ts +12 -4
- package/dist/engine/spec-templates/query.d.ts.map +1 -1
- package/dist/engine/spec-templates/query.js +29 -7
- package/dist/engine/spec-templates/query.js.map +1 -1
- package/dist/engine/spec-templates/renderer.d.ts +27 -2
- package/dist/engine/spec-templates/renderer.d.ts.map +1 -1
- package/dist/engine/spec-templates/renderer.js +119 -4
- package/dist/engine/spec-templates/renderer.js.map +1 -1
- package/dist/engine/spec-templates/templates-api-ui.d.ts.map +1 -1
- package/dist/engine/spec-templates/templates-api-ui.js +28 -1
- package/dist/engine/spec-templates/templates-api-ui.js.map +1 -1
- package/dist/engine/spec-templates/templates-auth-crud.d.ts.map +1 -1
- package/dist/engine/spec-templates/templates-auth-crud.js +27 -0
- package/dist/engine/spec-templates/templates-auth-crud.js.map +1 -1
- package/dist/engine/spec-templates/templates-data-security.d.ts.map +1 -1
- package/dist/engine/spec-templates/templates-data-security.js +26 -0
- package/dist/engine/spec-templates/templates-data-security.js.map +1 -1
- package/dist/engine/spec-templates/templates-industry-ecom.d.ts +6 -0
- package/dist/engine/spec-templates/templates-industry-ecom.d.ts.map +1 -0
- package/dist/engine/spec-templates/templates-industry-ecom.js +209 -0
- package/dist/engine/spec-templates/templates-industry-ecom.js.map +1 -0
- package/dist/engine/spec-templates/templates-industry-fintech.d.ts +8 -0
- package/dist/engine/spec-templates/templates-industry-fintech.d.ts.map +1 -0
- package/dist/engine/spec-templates/templates-industry-fintech.js +350 -0
- package/dist/engine/spec-templates/templates-industry-fintech.js.map +1 -0
- package/dist/engine/spec-templates/templates-industry-health-ecom.d.ts +3 -0
- package/dist/engine/spec-templates/templates-industry-health-ecom.d.ts.map +1 -0
- package/dist/engine/spec-templates/templates-industry-health-ecom.js +5 -0
- package/dist/engine/spec-templates/templates-industry-health-ecom.js.map +1 -0
- package/dist/engine/spec-templates/templates-industry-health.d.ts +6 -0
- package/dist/engine/spec-templates/templates-industry-health.d.ts.map +1 -0
- package/dist/engine/spec-templates/templates-industry-health.js +208 -0
- package/dist/engine/spec-templates/templates-industry-health.js.map +1 -0
- package/dist/engine/spec-templates/templates-industry-saas.d.ts +8 -0
- package/dist/engine/spec-templates/templates-industry-saas.d.ts.map +1 -0
- package/dist/engine/spec-templates/templates-industry-saas.js +323 -0
- package/dist/engine/spec-templates/templates-industry-saas.js.map +1 -0
- package/dist/engine/spec-templates/templates-perf-integration.d.ts.map +1 -1
- package/dist/engine/spec-templates/templates-perf-integration.js +27 -0
- package/dist/engine/spec-templates/templates-perf-integration.js.map +1 -1
- package/dist/resources/process.js +1 -1
- package/dist/tools/ci-planu-handler.d.ts +8 -0
- package/dist/tools/ci-planu-handler.d.ts.map +1 -0
- package/dist/tools/ci-planu-handler.js +44 -0
- package/dist/tools/ci-planu-handler.js.map +1 -0
- package/dist/tools/init-project/handler.d.ts.map +1 -1
- package/dist/tools/init-project/handler.js +24 -159
- package/dist/tools/init-project/handler.js.map +1 -1
- package/dist/tools/init-project/result-builder.d.ts +4 -0
- package/dist/tools/init-project/result-builder.d.ts.map +1 -0
- package/dist/tools/init-project/result-builder.js +150 -0
- package/dist/tools/init-project/result-builder.js.map +1 -0
- package/dist/tools/learn.d.ts.map +1 -1
- package/dist/tools/learn.js +67 -14
- package/dist/tools/learn.js.map +1 -1
- package/dist/tools/license-status.d.ts.map +1 -1
- package/dist/tools/license-status.js +17 -2
- package/dist/tools/license-status.js.map +1 -1
- package/dist/tools/register-ci-tools.d.ts.map +1 -1
- package/dist/tools/register-ci-tools.js +36 -0
- package/dist/tools/register-ci-tools.js.map +1 -1
- package/dist/tools/register-template-tools.d.ts.map +1 -1
- package/dist/tools/register-template-tools.js +21 -8
- package/dist/tools/register-template-tools.js.map +1 -1
- package/dist/tools/spec-templates.d.ts +1 -1
- package/dist/tools/spec-templates.d.ts.map +1 -1
- package/dist/tools/spec-templates.js +20 -6
- package/dist/tools/spec-templates.js.map +1 -1
- package/dist/types/ci.d.ts +51 -0
- package/dist/types/ci.d.ts.map +1 -1
- package/dist/types/project/core.d.ts +46 -5
- package/dist/types/project/core.d.ts.map +1 -1
- package/dist/types/spec-templates.d.ts +51 -1
- package/dist/types/spec-templates.d.ts.map +1 -1
- package/dist/types/vector-store.d.ts +7 -0
- package/dist/types/vector-store.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/config/license-plans.json +7 -1
|
@@ -88,7 +88,13 @@
|
|
|
88
88
|
"manage_hooks",
|
|
89
89
|
"apply_template",
|
|
90
90
|
"check_spec_accuracy",
|
|
91
|
-
"update_registry"
|
|
91
|
+
"update_registry",
|
|
92
|
+
"generate_planu_ci",
|
|
93
|
+
"transform_code",
|
|
94
|
+
"recommend_model",
|
|
95
|
+
"semantic_search",
|
|
96
|
+
"activate_group",
|
|
97
|
+
"list_groups"
|
|
92
98
|
],
|
|
93
99
|
"alwaysAllowed": [
|
|
94
100
|
"activate_license",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PlanuConfigOptions } from '../../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generate the YAML content for a .planu.yml configuration file.
|
|
4
|
+
* This file configures the Planu CI check workflow behavior.
|
|
5
|
+
*/
|
|
6
|
+
export declare function generatePlanuConfigYaml(options: PlanuConfigOptions): string;
|
|
7
|
+
//# sourceMappingURL=planu-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planu-config.d.ts","sourceRoot":"","sources":["../../../src/engine/ci-generator/planu-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAkD3E"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// ci-generator/planu-config.ts — Generate .planu.yml config file (SPEC-066 AC-05)
|
|
2
|
+
/**
|
|
3
|
+
* Generate the YAML content for a .planu.yml configuration file.
|
|
4
|
+
* This file configures the Planu CI check workflow behavior.
|
|
5
|
+
*/
|
|
6
|
+
export function generatePlanuConfigYaml(options) {
|
|
7
|
+
const { specsDir, failOnDrift, severityThreshold, postComment, badge, include, exclude, licenseKeyRef, } = options;
|
|
8
|
+
const lines = ['# .planu.yml — Planu CI configuration', ''];
|
|
9
|
+
// Specs section
|
|
10
|
+
lines.push('specs:');
|
|
11
|
+
lines.push(` directory: ${specsDir}`);
|
|
12
|
+
if (include && include.length > 0) {
|
|
13
|
+
lines.push(' include:');
|
|
14
|
+
for (const spec of include) {
|
|
15
|
+
lines.push(` - ${spec}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (exclude && exclude.length > 0) {
|
|
19
|
+
lines.push(' exclude:');
|
|
20
|
+
for (const spec of exclude) {
|
|
21
|
+
lines.push(` - ${spec}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
lines.push('');
|
|
25
|
+
// CI section
|
|
26
|
+
lines.push('ci:');
|
|
27
|
+
lines.push(` fail-on-drift: ${String(failOnDrift)}`);
|
|
28
|
+
lines.push(` severity-threshold: ${severityThreshold}`);
|
|
29
|
+
lines.push(` post-comment: ${String(postComment)}`);
|
|
30
|
+
lines.push(` badge: ${String(badge)}`);
|
|
31
|
+
// License section
|
|
32
|
+
if (licenseKeyRef) {
|
|
33
|
+
lines.push('');
|
|
34
|
+
lines.push('license:');
|
|
35
|
+
lines.push(` key: \${${licenseKeyRef}}`);
|
|
36
|
+
}
|
|
37
|
+
lines.push('');
|
|
38
|
+
return lines.join('\n');
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=planu-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planu-config.js","sourceRoot":"","sources":["../../../src/engine/ci-generator/planu-config.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAIlF;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAA2B;IACjE,MAAM,EACJ,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,KAAK,EACL,OAAO,EACP,OAAO,EACP,aAAa,GACd,GAAG,OAAO,CAAC;IAEZ,MAAM,KAAK,GAAa,CAAC,uCAAuC,EAAE,EAAE,CAAC,CAAC;IAEtE,gBAAgB;IAChB,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrB,KAAK,CAAC,IAAI,CAAC,gBAAgB,QAAQ,EAAE,C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C1B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GeneratePlanuCIInput, GeneratePlanuCIResult } from '../../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generate the markdown snippet for adding a planu spec badge to README.
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateBadgeMarkdown(owner: string, repo: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Generate a complete Planu CI check workflow with optional drift detection,
|
|
8
|
+
* PR comments, badge generation, and configurable severity thresholds.
|
|
9
|
+
*/
|
|
10
|
+
export declare function generatePlanuCI(input: GeneratePlanuCIInput): GeneratePlanuCIResult;
|
|
11
|
+
//# sourceMappingURL=planu-steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planu-steps.d.ts","sourceRoot":"","sources":["../../../src/engine/ci-generator/planu-steps.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,oBAAoB,EACpB,qBAAqB,EAEtB,MAAM,sBAAsB,CAAC;AAY9B;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGzE;AAmPD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,qBAAqB,CAwElF"}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
// ci-generator/planu-steps.ts — Generate Planu-specific CI workflow YAML (SPEC-066 AC-02..07)
|
|
2
|
+
import { generatePlanuConfigYaml } from './planu-config.js';
|
|
3
|
+
// -- Constants ---------------------------------------------------------------
|
|
4
|
+
const DEFAULT_SPECS_DIR = 'docs/sdd/specs';
|
|
5
|
+
const WORKFLOW_PATH = '.github/workflows/planu-check.yml';
|
|
6
|
+
const COMMENT_MARKER = '<!-- planu-ci-report -->';
|
|
7
|
+
// -- Badge generation --------------------------------------------------------
|
|
8
|
+
/**
|
|
9
|
+
* Generate the markdown snippet for adding a planu spec badge to README.
|
|
10
|
+
*/
|
|
11
|
+
export function generateBadgeMarkdown(owner, repo) {
|
|
12
|
+
const url = `https://img.shields.io/endpoint?url=https://planu.dev/badge/${owner}/${repo}`;
|
|
13
|
+
return `[](https://planu.dev)`;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Generate the badge update step YAML lines for the CI workflow.
|
|
17
|
+
* Runs only on main/master push and creates a badge JSON endpoint.
|
|
18
|
+
*/
|
|
19
|
+
function buildBadgeStepLines(indent) {
|
|
20
|
+
return [
|
|
21
|
+
`${indent}- name: Generate spec badge`,
|
|
22
|
+
`${indent} if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'`,
|
|
23
|
+
`${indent} run: |`,
|
|
24
|
+
`${indent} TOTAL=$(echo "$PLANU_RESULTS" | grep -c "SPEC-" || echo "0")`,
|
|
25
|
+
`${indent} ISSUES=$(echo "$PLANU_RESULTS" | grep -c "FAIL" || echo "0")`,
|
|
26
|
+
`${indent} if [ "$ISSUES" = "0" ]; then`,
|
|
27
|
+
`${indent} COLOR="brightgreen"`,
|
|
28
|
+
`${indent} MSG="passing"`,
|
|
29
|
+
`${indent} else`,
|
|
30
|
+
`${indent} COLOR="red"`,
|
|
31
|
+
`${indent} MSG="$ISSUES issues"`,
|
|
32
|
+
`${indent} fi`,
|
|
33
|
+
`${indent} echo "{\\"schemaVersion\\":1,\\"label\\":\\"planu\\",\\"message\\":\\"$MSG\\",\\"color\\":\\"$COLOR\\"}" > planu-badge.json`,
|
|
34
|
+
`${indent} env:`,
|
|
35
|
+
`${indent} PLANU_RESULTS: \${{ steps.validate.outputs.results }}`,
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
// -- PR comment step ---------------------------------------------------------
|
|
39
|
+
function buildCommentStepLines(indent) {
|
|
40
|
+
return [
|
|
41
|
+
`${indent}- name: Post results to PR`,
|
|
42
|
+
`${indent} if: github.event_name == 'pull_request'`,
|
|
43
|
+
`${indent} uses: actions/github-script@v7`,
|
|
44
|
+
`${indent} with:`,
|
|
45
|
+
`${indent} script: |`,
|
|
46
|
+
`${indent} const marker = '${COMMENT_MARKER}';`,
|
|
47
|
+
`${indent} const body = marker + '\\n' + process.env.PLANU_COMMENT;`,
|
|
48
|
+
`${indent} const { data: comments } = await github.rest.issues.listComments({`,
|
|
49
|
+
`${indent} owner: context.repo.owner,`,
|
|
50
|
+
`${indent} repo: context.repo.repo,`,
|
|
51
|
+
`${indent} issue_number: context.issue.number,`,
|
|
52
|
+
`${indent} });`,
|
|
53
|
+
`${indent} const existing = comments.find(c => c.body && c.body.includes(marker));`,
|
|
54
|
+
`${indent} if (existing) {`,
|
|
55
|
+
`${indent} await github.rest.issues.updateComment({`,
|
|
56
|
+
`${indent} owner: context.repo.owner,`,
|
|
57
|
+
`${indent} repo: context.repo.repo,`,
|
|
58
|
+
`${indent} comment_id: existing.id,`,
|
|
59
|
+
`${indent} body,`,
|
|
60
|
+
`${indent} });`,
|
|
61
|
+
`${indent} } else {`,
|
|
62
|
+
`${indent} await github.rest.issues.createComment({`,
|
|
63
|
+
`${indent} owner: context.repo.owner,`,
|
|
64
|
+
`${indent} repo: context.repo.repo,`,
|
|
65
|
+
`${indent} issue_number: context.issue.number,`,
|
|
66
|
+
`${indent} body,`,
|
|
67
|
+
`${indent} });`,
|
|
68
|
+
`${indent} }`,
|
|
69
|
+
`${indent} env:`,
|
|
70
|
+
`${indent} PLANU_COMMENT: \${{ steps.validate.outputs.comment }}`,
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
// -- Severity / exit code step -----------------------------------------------
|
|
74
|
+
function buildSeverityStepLines(indent, threshold, failOnDrift) {
|
|
75
|
+
if (!failOnDrift) {
|
|
76
|
+
return [
|
|
77
|
+
`${indent}- name: Check severity threshold`,
|
|
78
|
+
`${indent} run: echo "Drift detection is informational only (fail-on-drift=false)"`,
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
const thresholdCondition = threshold === 'critical'
|
|
82
|
+
? 'CRITICAL_COUNT=$(echo "$PLANU_RESULTS" | grep -c "CRITICAL" || echo "0") && [ "$CRITICAL_COUNT" -gt 0 ]'
|
|
83
|
+
: threshold === 'warning'
|
|
84
|
+
? 'ISSUE_COUNT=$(echo "$PLANU_RESULTS" | grep -cE "(FAIL|DRIFT)" || echo "0") && [ "$ISSUE_COUNT" -gt 0 ]'
|
|
85
|
+
: 'true';
|
|
86
|
+
if (threshold === 'info') {
|
|
87
|
+
return [
|
|
88
|
+
`${indent}- name: Check severity threshold`,
|
|
89
|
+
`${indent} run: echo "Severity threshold is info — always passes"`,
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
return [
|
|
93
|
+
`${indent}- name: Check severity threshold`,
|
|
94
|
+
`${indent} run: |`,
|
|
95
|
+
`${indent} if ${thresholdCondition}; then`,
|
|
96
|
+
`${indent} echo "::error::Planu specs have issues above ${threshold} threshold"`,
|
|
97
|
+
`${indent} exit 1`,
|
|
98
|
+
`${indent} fi`,
|
|
99
|
+
`${indent} echo "All specs within ${threshold} threshold"`,
|
|
100
|
+
`${indent} env:`,
|
|
101
|
+
`${indent} PLANU_RESULTS: \${{ steps.validate.outputs.results }}`,
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
// -- Drift detection step ----------------------------------------------------
|
|
105
|
+
function buildDriftStepLines(indent, specsDir) {
|
|
106
|
+
return [
|
|
107
|
+
`${indent}- name: Detect spec drift`,
|
|
108
|
+
`${indent} id: drift`,
|
|
109
|
+
`${indent} run: |`,
|
|
110
|
+
`${indent} CHANGED_FILES=$(git diff origin/main...HEAD --name-only 2>/dev/null || echo "")`,
|
|
111
|
+
`${indent} echo "Changed files:"`,
|
|
112
|
+
`${indent} echo "$CHANGED_FILES"`,
|
|
113
|
+
`${indent} DRIFT_FOUND="false"`,
|
|
114
|
+
`${indent} for spec_dir in ${specsDir}/*/; do`,
|
|
115
|
+
`${indent} if [ -f "$spec_dir/technical.md" ] || [ -f "$spec_dir/FICHA-TECNICA.md" ]; then`,
|
|
116
|
+
`${indent} TECH_FILE=$(ls "$spec_dir"technical.md "$spec_dir"FICHA-TECNICA.md 2>/dev/null | head -1)`,
|
|
117
|
+
`${indent} SPEC_FILES=$(grep -oE 'src/[a-zA-Z0-9_./-]+' "$TECH_FILE" 2>/dev/null || echo "")`,
|
|
118
|
+
`${indent} for sf in $SPEC_FILES; do`,
|
|
119
|
+
`${indent} if echo "$CHANGED_FILES" | grep -q "$sf"; then`,
|
|
120
|
+
`${indent} SPEC_NAME=$(basename "$spec_dir")`,
|
|
121
|
+
`${indent} echo "::warning::Drift detected: $sf modified, belongs to $SPEC_NAME"`,
|
|
122
|
+
`${indent} DRIFT_FOUND="true"`,
|
|
123
|
+
`${indent} fi`,
|
|
124
|
+
`${indent} done`,
|
|
125
|
+
`${indent} fi`,
|
|
126
|
+
`${indent} done`,
|
|
127
|
+
`${indent} echo "drift-detected=$DRIFT_FOUND" >> $GITHUB_OUTPUT`,
|
|
128
|
+
];
|
|
129
|
+
}
|
|
130
|
+
// -- Validate step -----------------------------------------------------------
|
|
131
|
+
function buildValidateStepLines(indent, specsDir) {
|
|
132
|
+
return [
|
|
133
|
+
`${indent}- name: Validate specs`,
|
|
134
|
+
`${indent} id: validate`,
|
|
135
|
+
`${indent} run: |`,
|
|
136
|
+
`${indent} RESULTS=""`,
|
|
137
|
+
`${indent} COMMENT="## Planu CI -- Reporte de Specs\\n\\n"`,
|
|
138
|
+
`${indent} COMMENT+="### Validacion de Specs\\n"`,
|
|
139
|
+
`${indent} COMMENT+="| Spec | Estado | Criterios |\\n"`,
|
|
140
|
+
`${indent} COMMENT+="|------|--------|-----------|\\n"`,
|
|
141
|
+
`${indent} TOTAL=0`,
|
|
142
|
+
`${indent} ISSUES=0`,
|
|
143
|
+
`${indent} for spec_dir in ${specsDir}/*/; do`,
|
|
144
|
+
`${indent} [ -d "$spec_dir" ] || continue`,
|
|
145
|
+
`${indent} SPEC_NAME=$(basename "$spec_dir")`,
|
|
146
|
+
`${indent} TOTAL=$((TOTAL + 1))`,
|
|
147
|
+
`${indent} SPEC_FILE=$(ls "$spec_dir"spec.md "$spec_dir"HU.md 2>/dev/null | head -1)`,
|
|
148
|
+
`${indent} if [ -z "$SPEC_FILE" ]; then`,
|
|
149
|
+
`${indent} RESULTS+="$SPEC_NAME FAIL missing-spec\\n"`,
|
|
150
|
+
`${indent} COMMENT+="| $SPEC_NAME | FAIL | missing spec.md |\\n"`,
|
|
151
|
+
`${indent} ISSUES=$((ISSUES + 1))`,
|
|
152
|
+
`${indent} continue`,
|
|
153
|
+
`${indent} fi`,
|
|
154
|
+
`${indent} CRITERIA=$(grep -c "^### AC-" "$SPEC_FILE" 2>/dev/null || echo "0")`,
|
|
155
|
+
`${indent} PROGRESS_FILE=$(ls "$spec_dir"progress.md "$spec_dir"PROGRESS.md 2>/dev/null | head -1)`,
|
|
156
|
+
`${indent} if [ -n "$PROGRESS_FILE" ]; then`,
|
|
157
|
+
`${indent} DONE=$(grep -c "Completado\\|Done\\|DONE" "$PROGRESS_FILE" 2>/dev/null || echo "0")`,
|
|
158
|
+
`${indent} else`,
|
|
159
|
+
`${indent} DONE=0`,
|
|
160
|
+
`${indent} fi`,
|
|
161
|
+
`${indent} if [ "$DONE" -ge "$CRITERIA" ] && [ "$CRITERIA" -gt 0 ]; then`,
|
|
162
|
+
`${indent} STATUS="PASS"`,
|
|
163
|
+
`${indent} RESULTS+="$SPEC_NAME PASS $DONE/$CRITERIA\\n"`,
|
|
164
|
+
`${indent} else`,
|
|
165
|
+
`${indent} STATUS="FAIL"`,
|
|
166
|
+
`${indent} ISSUES=$((ISSUES + 1))`,
|
|
167
|
+
`${indent} RESULTS+="$SPEC_NAME FAIL $DONE/$CRITERIA\\n"`,
|
|
168
|
+
`${indent} fi`,
|
|
169
|
+
`${indent} COMMENT+="| $SPEC_NAME | $STATUS | $DONE/$CRITERIA |\\n"`,
|
|
170
|
+
`${indent} done`,
|
|
171
|
+
`${indent} COMMENT+="\\n### Resumen\\n"`,
|
|
172
|
+
`${indent} COMMENT+="- Total specs verificadas: $TOTAL\\n"`,
|
|
173
|
+
`${indent} COMMENT+="- Specs con problemas: $ISSUES\\n"`,
|
|
174
|
+
`${indent} if [ "$TOTAL" = "0" ]; then`,
|
|
175
|
+
`${indent} COMMENT="## Planu CI -- Reporte de Specs\\n\\nTodas las specs estan en orden."`,
|
|
176
|
+
`${indent} fi`,
|
|
177
|
+
`${indent} echo "results<<EOF" >> $GITHUB_OUTPUT`,
|
|
178
|
+
`${indent} echo -e "$RESULTS" >> $GITHUB_OUTPUT`,
|
|
179
|
+
`${indent} echo "EOF" >> $GITHUB_OUTPUT`,
|
|
180
|
+
`${indent} echo "comment<<EOF" >> $GITHUB_OUTPUT`,
|
|
181
|
+
`${indent} echo -e "$COMMENT" >> $GITHUB_OUTPUT`,
|
|
182
|
+
`${indent} echo "EOF" >> $GITHUB_OUTPUT`,
|
|
183
|
+
`${indent} echo "issues=$ISSUES" >> $GITHUB_OUTPUT`,
|
|
184
|
+
];
|
|
185
|
+
}
|
|
186
|
+
// -- Workflow header builder --------------------------------------------------
|
|
187
|
+
function buildWorkflowHeader(postComment, workingDirectory) {
|
|
188
|
+
const lines = [];
|
|
189
|
+
lines.push('name: Planu Spec Check');
|
|
190
|
+
lines.push('');
|
|
191
|
+
lines.push('on:');
|
|
192
|
+
lines.push(' push:');
|
|
193
|
+
lines.push(' branches: [main, master]');
|
|
194
|
+
lines.push(' pull_request:');
|
|
195
|
+
lines.push(' branches: [main, master, develop]');
|
|
196
|
+
lines.push(' workflow_dispatch:');
|
|
197
|
+
lines.push('');
|
|
198
|
+
if (postComment) {
|
|
199
|
+
lines.push('permissions:');
|
|
200
|
+
lines.push(' contents: read');
|
|
201
|
+
lines.push(' pull-requests: write');
|
|
202
|
+
lines.push(' issues: write');
|
|
203
|
+
lines.push('');
|
|
204
|
+
}
|
|
205
|
+
lines.push('jobs:');
|
|
206
|
+
lines.push(' planu-check:');
|
|
207
|
+
lines.push(' name: Planu Spec Validation');
|
|
208
|
+
lines.push(' runs-on: ubuntu-latest');
|
|
209
|
+
if (workingDirectory !== '.') {
|
|
210
|
+
lines.push(` defaults:`);
|
|
211
|
+
lines.push(` run:`);
|
|
212
|
+
lines.push(` working-directory: ${workingDirectory}`);
|
|
213
|
+
}
|
|
214
|
+
return lines;
|
|
215
|
+
}
|
|
216
|
+
function buildConfigReadStep(ind) {
|
|
217
|
+
return [
|
|
218
|
+
`${ind}- name: Read .planu.yml config`,
|
|
219
|
+
`${ind} id: config`,
|
|
220
|
+
`${ind} run: |`,
|
|
221
|
+
`${ind} if [ -f ".planu.yml" ]; then`,
|
|
222
|
+
`${ind} echo "config-found=true" >> $GITHUB_OUTPUT`,
|
|
223
|
+
`${ind} echo "Planu config found at .planu.yml"`,
|
|
224
|
+
`${ind} else`,
|
|
225
|
+
`${ind} echo "config-found=false" >> $GITHUB_OUTPUT`,
|
|
226
|
+
`${ind} echo "No .planu.yml found, using defaults"`,
|
|
227
|
+
`${ind} fi`,
|
|
228
|
+
];
|
|
229
|
+
}
|
|
230
|
+
// -- Main generator ----------------------------------------------------------
|
|
231
|
+
/**
|
|
232
|
+
* Generate a complete Planu CI check workflow with optional drift detection,
|
|
233
|
+
* PR comments, badge generation, and configurable severity thresholds.
|
|
234
|
+
*/
|
|
235
|
+
export function generatePlanuCI(input) {
|
|
236
|
+
const { specsDir = DEFAULT_SPECS_DIR, detectDrift = true, failOnDrift = true, severityThreshold = 'warning', postComment = true, badge = true, workingDirectory = '.', } = input;
|
|
237
|
+
const features = ['validate'];
|
|
238
|
+
const ind = ' ';
|
|
239
|
+
const lines = buildWorkflowHeader(postComment, workingDirectory);
|
|
240
|
+
lines.push(' steps:');
|
|
241
|
+
lines.push(`${ind}- name: Checkout code`);
|
|
242
|
+
lines.push(`${ind} uses: actions/checkout@v4`);
|
|
243
|
+
lines.push(`${ind} with:`);
|
|
244
|
+
lines.push(`${ind} fetch-depth: 0`);
|
|
245
|
+
lines.push('');
|
|
246
|
+
features.push('planu-config');
|
|
247
|
+
lines.push(...buildConfigReadStep(ind));
|
|
248
|
+
lines.push('');
|
|
249
|
+
const resolvedSpecsDir = workingDirectory === '.' ? specsDir : `${workingDirectory}/${specsDir}`;
|
|
250
|
+
lines.push(...buildValidateStepLines(ind, resolvedSpecsDir));
|
|
251
|
+
lines.push('');
|
|
252
|
+
if (detectDrift) {
|
|
253
|
+
features.push('detect-drift');
|
|
254
|
+
lines.push(...buildDriftStepLines(ind, resolvedSpecsDir));
|
|
255
|
+
lines.push('');
|
|
256
|
+
}
|
|
257
|
+
if (postComment) {
|
|
258
|
+
features.push('pr-comment');
|
|
259
|
+
lines.push(...buildCommentStepLines(ind));
|
|
260
|
+
lines.push('');
|
|
261
|
+
}
|
|
262
|
+
if (badge) {
|
|
263
|
+
features.push('badge');
|
|
264
|
+
lines.push(...buildBadgeStepLines(ind));
|
|
265
|
+
lines.push('');
|
|
266
|
+
}
|
|
267
|
+
if (failOnDrift) {
|
|
268
|
+
features.push('fail-on-drift');
|
|
269
|
+
}
|
|
270
|
+
lines.push(...buildSeverityStepLines(ind, severityThreshold, failOnDrift));
|
|
271
|
+
lines.push('');
|
|
272
|
+
lines.push(' outputs:');
|
|
273
|
+
lines.push(' drift-detected: ${{ steps.drift.outputs.drift-detected }}');
|
|
274
|
+
lines.push(' issues: ${{ steps.validate.outputs.issues }}');
|
|
275
|
+
const workflowYaml = lines.join('\n') + '\n';
|
|
276
|
+
const planuConfigYaml = generatePlanuConfigYaml({
|
|
277
|
+
specsDir,
|
|
278
|
+
failOnDrift,
|
|
279
|
+
severityThreshold,
|
|
280
|
+
postComment,
|
|
281
|
+
badge,
|
|
282
|
+
});
|
|
283
|
+
const badgeMarkdown = generateBadgeMarkdown('{owner}', '{repo}');
|
|
284
|
+
return {
|
|
285
|
+
workflowYaml,
|
|
286
|
+
workflowPath: WORKFLOW_PATH,
|
|
287
|
+
planuConfigYaml,
|
|
288
|
+
badgeMarkdown,
|
|
289
|
+
features,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=planu-steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planu-steps.js","sourceRoot":"","sources":["../../../src/engine/ci-generator/planu-steps.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAS9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,+EAA+E;AAE/E,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAC3C,MAAM,aAAa,GAAG,mCAAmC,CAAC;AAC1D,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAElD,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAa,EAAE,IAAY;IAC/D,MAAM,GAAG,GAAG,+DAA+D,KAAK,IAAI,IAAI,EAAE,CAAC;IAC3F,OAAO,mBAAmB,GAAG,uBAAuB,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,SAAS,mBAAmB,CAAC,MAAc;IACzC,OAAO;QACL,GAAG,MAAM,6BAA6B;QACtC,GAAG,MAAM,4EAA4E;QACrF,GAAG,MAAM,UAAU;QACnB,GAAG,MAAM,kEAAkE;QAC3E,GAAG,MAAM,kEAAkE;QAC3E,GAAG,MAAM,kCAAkC;QAC3C,GAAG,MAAM,2BAA2B;QACpC,GAAG,MAAM,qBAAqB;QAC9B,GAAG,MAAM,UAAU;QACnB,GAAG,MAAM,mBAAmB;QAC5B,GAAG,MAAM,4BAA4B;QACrC,GAAG,MAAM,QAAQ;QACjB,GAAG,MAAM,iIAAiI;QAC1I,GAAG,MAAM,QAAQ;QACjB,GAAG,MAAM,2DAA2D;KACrE,CAAC;AACJ,CAAC;AAED,+EAA+E;AAE/E,SAAS,qBAAqB,CAAC,MAAc;IAC3C,OAAO;QACL,GAAG,MAAM,4BAA4B;QACrC,GAAG,MAAM,2CAA2C;QACpD,GAAG,MAAM,kCAAkC;QAC3C,GAAG,MAAM,SAAS;QAClB,GAAG,MAAM,eAAe;QACxB,GAA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AC;IAC3B,KAAK,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;IAC9E,KAAK,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;IAEjE,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC7C,MAAM,eAAe,GAAG,uBAAuB,CAAC;QAC9C,QAAQ;QACR,WAAW;QACX,iBAAiB;QACjB,WAAW;QACX,KAAK;KACN,CAAC,CAAC;IACH,MAAM,aAAa,GAAG,qBAAqB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAEjE,OAAO;QACL,YAAY;QACZ,YAAY,EAAE,aAAa;QAC3B,eAAe;QACf,aAAa;QACb,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-industry.d.ts","sourceRoot":"","sources":["../../../src/engine/spec-templates/catalog-industry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAkBvE,uCAAuC;AACvC,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,EAWjD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// engine/spec-templates/catalog-industry.ts — Industry vertical templates (AC-04).
|
|
2
|
+
// Re-exports all industry templates from their dedicated files.
|
|
3
|
+
import { FINTECH_KYC_TEMPLATE, FINTECH_TRANSACTIONS_TEMPLATE, FINTECH_COMPLIANCE_TEMPLATE, } from './templates-industry-fintech.js';
|
|
4
|
+
import { HEALTHTECH_PATIENT_RECORDS_TEMPLATE, HEALTHTECH_APPOINTMENTS_TEMPLATE, ECOMMERCE_CART_CHECKOUT_TEMPLATE, ECOMMERCE_INVENTORY_TEMPLATE, } from './templates-industry-health-ecom.js';
|
|
5
|
+
import { SAAS_MULTI_TENANT_TEMPLATE, SAAS_BILLING_TEMPLATE, SAAS_ROLES_TEMPLATE, } from './templates-industry-saas.js';
|
|
6
|
+
/** All industry vertical templates. */
|
|
7
|
+
export const INDUSTRY_TEMPLATES = [
|
|
8
|
+
FINTECH_KYC_TEMPLATE,
|
|
9
|
+
FINTECH_TRANSACTIONS_TEMPLATE,
|
|
10
|
+
FINTECH_COMPLIANCE_TEMPLATE,
|
|
11
|
+
HEALTHTECH_PATIENT_RECORDS_TEMPLATE,
|
|
12
|
+
HEALTHTECH_APPOINTMENTS_TEMPLATE,
|
|
13
|
+
ECOMMERCE_CART_CHECKOUT_TEMPLATE,
|
|
14
|
+
ECOMMERCE_INVENTORY_TEMPLATE,
|
|
15
|
+
SAAS_MULTI_TENANT_TEMPLATE,
|
|
16
|
+
SAAS_BILLING_TEMPLATE,
|
|
17
|
+
SAAS_ROLES_TEMPLATE,
|
|
18
|
+
];
|
|
19
|
+
//# sourceMappingURL=catalog-industry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-industry.js","sourceRoot":"","sources":["../../../src/engine/spec-templates/catalog-industry.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,gEAAgE;AAGhE,OAAO,EACL,oBAAoB,EACpB,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,mCAAmC,EACnC,gCAAgC,EAChC,gCAAgC,EAChC,4BAA4B,GAC7B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AAEtC,uCAAuC;AACvC,MAAM,CAAC,MAAM,kBAAkB,GAAwB;IACrD,oBAAoB;IACpB,6BAA6B;IAC7B,2BAA2B;IAC3B,mCAAmC;IACnC,gCAAgC;IAChC,gCAAgC;IAChC,4BAA4B;IAC5B,0BAA0B;IAC1B,qBAAqB;IACrB,mBAAmB;CACpB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SpecTemplateEntry } from '../../types/spec-templates.js';
|
|
2
|
-
/** Full catalog of built-in spec templates (core + extra). */
|
|
2
|
+
/** Full catalog of built-in spec templates (core + extra + industry). */
|
|
3
3
|
export declare const BUILT_IN_TEMPLATES: SpecTemplateEntry[];
|
|
4
4
|
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/engine/spec-templates/catalog.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/engine/spec-templates/catalog.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAMvE,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,EAOjD,CAAC"}
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
import { AUTH_JWT_TEMPLATE, CRUD_ENTITY_TEMPLATE } from './templates-auth-crud.js';
|
|
5
5
|
import { REST_API_ENDPOINT_TEMPLATE, UI_FORM_TEMPLATE } from './templates-api-ui.js';
|
|
6
6
|
import { EXTRA_TEMPLATES } from './catalog-extra.js';
|
|
7
|
-
|
|
7
|
+
import { INDUSTRY_TEMPLATES } from './catalog-industry.js';
|
|
8
|
+
/** Full catalog of built-in spec templates (core + extra + industry). */
|
|
8
9
|
export const BUILT_IN_TEMPLATES = [
|
|
9
10
|
AUTH_JWT_TEMPLATE,
|
|
10
11
|
CRUD_ENTITY_TEMPLATE,
|
|
11
12
|
REST_API_ENDPOINT_TEMPLATE,
|
|
12
13
|
UI_FORM_TEMPLATE,
|
|
13
14
|
...EXTRA_TEMPLATES,
|
|
15
|
+
...INDUSTRY_TEMPLATES,
|
|
14
16
|
];
|
|
15
17
|
//# sourceMappingURL=catalog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../src/engine/spec-templates/catalog.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,8EAA8E;AAC9E,+DAA+D;AAG/D,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../src/engine/spec-templates/catalog.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,8EAA8E;AAC9E,+DAA+D;AAG/D,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,yEAAyE;AACzE,MAAM,CAAC,MAAM,kBAAkB,GAAwB;IACrD,iBAAiB;IACjB,oBAAoB;IACpB,0BAA0B;IAC1B,gBAAgB;IAChB,GAAG,eAAe;IAClB,GAAG,kBAAkB;CACtB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SpecTemplateEntry, CustomTemplateLoadResult } from '../../types/spec-templates.js';
|
|
2
|
+
/**
|
|
3
|
+
* Loads custom templates from a directory. Each .json file is validated.
|
|
4
|
+
* Malformed files generate warnings but do not block loading of other templates.
|
|
5
|
+
*/
|
|
6
|
+
export declare function loadCustomTemplates(baseDir?: string): Promise<CustomTemplateLoadResult>;
|
|
7
|
+
/**
|
|
8
|
+
* Merges custom templates with built-in templates.
|
|
9
|
+
* Custom templates override built-in templates with the same ID.
|
|
10
|
+
*/
|
|
11
|
+
export declare function mergeTemplates(builtIn: SpecTemplateEntry[], custom: SpecTemplateEntry[]): SpecTemplateEntry[];
|
|
12
|
+
//# sourceMappingURL=custom-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-loader.d.ts","sourceRoot":"","sources":["../../../src/engine/spec-templates/custom-loader.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,+BAA+B,CAAC;AA6DvC;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC,CA6B7F;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,iBAAiB,EAAE,EAC5B,MAAM,EAAE,iBAAiB,EAAE,GAC1B,iBAAiB,EAAE,CAIrB"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// engine/spec-templates/custom-loader.ts — Loads custom user templates from data/global/.
|
|
2
|
+
// AC-06: Custom templates from data/global/spec-templates/custom/.
|
|
3
|
+
// AC-11: Validates with Zod, reports malformed templates as warnings.
|
|
4
|
+
import { readdir, readFile } from 'node:fs/promises';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/** Zod schema for validating custom template JSON files. */
|
|
8
|
+
const templateVariableSchema = z.object({
|
|
9
|
+
key: z.string().min(1),
|
|
10
|
+
label: z.string().min(1),
|
|
11
|
+
description: z.string().min(1),
|
|
12
|
+
example: z.string().min(1),
|
|
13
|
+
required: z.boolean(),
|
|
14
|
+
defaultValue: z.string().optional(),
|
|
15
|
+
});
|
|
16
|
+
const templateCriterionSchema = z.object({
|
|
17
|
+
id: z.string().min(1),
|
|
18
|
+
title: z.string().min(1),
|
|
19
|
+
required: z.boolean(),
|
|
20
|
+
});
|
|
21
|
+
const complexityScoreSchema = z.enum(['S', 'M', 'L', 'XL']);
|
|
22
|
+
const estimationBaseSchema = z.object({
|
|
23
|
+
hoursMin: z.number().nonnegative(),
|
|
24
|
+
hoursMax: z.number().nonnegative(),
|
|
25
|
+
notes: z.string(),
|
|
26
|
+
});
|
|
27
|
+
const templateCategorySchema = z.enum([
|
|
28
|
+
'auth',
|
|
29
|
+
'crud',
|
|
30
|
+
'api',
|
|
31
|
+
'ui',
|
|
32
|
+
'infra',
|
|
33
|
+
'testing',
|
|
34
|
+
'integration',
|
|
35
|
+
'data',
|
|
36
|
+
'security',
|
|
37
|
+
'performance',
|
|
38
|
+
'industry',
|
|
39
|
+
]);
|
|
40
|
+
const industrySubcategorySchema = z.enum(['fintech', 'healthtech', 'ecommerce', 'saas']);
|
|
41
|
+
const customTemplateSchema = z.object({
|
|
42
|
+
id: z.string().min(1),
|
|
43
|
+
name: z.string().min(1),
|
|
44
|
+
category: templateCategorySchema,
|
|
45
|
+
subcategory: industrySubcategorySchema.optional(),
|
|
46
|
+
description: z.string().min(1),
|
|
47
|
+
tags: z.array(z.string()),
|
|
48
|
+
complexityScore: complexityScoreSchema,
|
|
49
|
+
estimationBase: estimationBaseSchema,
|
|
50
|
+
criteria: z.array(templateCriterionSchema),
|
|
51
|
+
variables: z.array(templateVariableSchema),
|
|
52
|
+
huTemplate: z.string().min(1),
|
|
53
|
+
fichaTecnicaTemplate: z.string().min(1),
|
|
54
|
+
progressTemplate: z.string().min(1),
|
|
55
|
+
});
|
|
56
|
+
/** Default directory for custom user templates. */
|
|
57
|
+
const CUSTOM_TEMPLATES_DIR = 'data/global/spec-templates/custom';
|
|
58
|
+
/**
|
|
59
|
+
* Loads custom templates from a directory. Each .json file is validated.
|
|
60
|
+
* Malformed files generate warnings but do not block loading of other templates.
|
|
61
|
+
*/
|
|
62
|
+
export async function loadCustomTemplates(baseDir) {
|
|
63
|
+
const dir = baseDir ?? CUSTOM_TEMPLATES_DIR;
|
|
64
|
+
const templates = [];
|
|
65
|
+
const warnings = [];
|
|
66
|
+
let files;
|
|
67
|
+
try {
|
|
68
|
+
files = await readdir(dir);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
// Directory does not exist — not an error, just no custom templates
|
|
72
|
+
return { templates, warnings };
|
|
73
|
+
}
|
|
74
|
+
const jsonFiles = files.filter((f) => f.endsWith('.json'));
|
|
75
|
+
for (const file of jsonFiles) {
|
|
76
|
+
const filePath = join(dir, file);
|
|
77
|
+
try {
|
|
78
|
+
const content = await readFile(filePath, 'utf-8');
|
|
79
|
+
const parsed = JSON.parse(content);
|
|
80
|
+
const validated = customTemplateSchema.parse(parsed);
|
|
81
|
+
templates.push(validated);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
85
|
+
warnings.push({ file: filePath, error: message });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return { templates, warnings };
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Merges custom templates with built-in templates.
|
|
92
|
+
* Custom templates override built-in templates with the same ID.
|
|
93
|
+
*/
|
|
94
|
+
export function mergeTemplates(builtIn, custom) {
|
|
95
|
+
const customIds = new Set(custom.map((t) => t.id));
|
|
96
|
+
const filtered = builtIn.filter((t) => !customIds.has(t.id));
|
|
97
|
+
return [...filtered, ...custom];
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=custom-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-loader.js","sourceRoot":"","sources":["../../../src/engine/spec-templates/custom-loader.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,mEAAmE;AACnE,sEAAsE;AAEtE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,4DAA4D;AAC5D,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE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AAE,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,GAAG,QAAQ,EAAE,GAAG,MAAM,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { BUILT_IN_TEMPLATES } from './catalog.js';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { INDUSTRY_TEMPLATES } from './catalog-industry.js';
|
|
3
|
+
export { listTemplates, findTemplate, findTemplateWithCustom, getAvailableCategories, } from './query.js';
|
|
4
|
+
export { renderTemplate, interpolate, findMissingRequired, resolveCriteria, filterHuByCriteria, filterProgressByCriteria, buildEstimationSection, } from './renderer.js';
|
|
5
|
+
export { loadCustomTemplates, mergeTemplates } from './custom-loader.js';
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/engine/spec-templates/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/engine/spec-templates/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,aAAa,EACb,YAAY,EACZ,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// engine/spec-templates/index.ts — Public API barrel for spec-templates engine.
|
|
2
2
|
export { BUILT_IN_TEMPLATES } from './catalog.js';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
3
|
+
export { INDUSTRY_TEMPLATES } from './catalog-industry.js';
|
|
4
|
+
export { listTemplates, findTemplate, findTemplateWithCustom, getAvailableCategories, } from './query.js';
|
|
5
|
+
export { renderTemplate, interpolate, findMissingRequired, resolveCriteria, filterHuByCriteria, filterProgressByCriteria, buildEstimationSection, } from './renderer.js';
|
|
6
|
+
export { loadCustomTemplates, mergeTemplates } from './custom-loader.js';
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/engine/spec-templates/index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/engine/spec-templates/index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,aAAa,EACb,YAAY,EACZ,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|